<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Log comments/pictures for {{place|escape}} {{people|escape}}</title>
    <script
      src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAALTdx9qjrdl_2yO4uD4jnWxQ_6N4dkHg7_wIKENxVG1go3UnpWxRwWZP6VSh5aDY53HnYXQe1FQQEGw" type="text/javascript"></script>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <link rel="icon" href="favicon.ico" type="image/x-icon">
  </head>
  <body onunload="GUnload()">
    <center>
      <h2>Add a comment (and snapshot) so other <font color="blue">{{place|escape}}</font> {{people|escape}} learn what you {{activity|escape}}</h2>
    </center>

    {% if mapdefined %} 
    Go to <a href="/?place={{place}}"> {{place }} map</a>
    <br />
    {% endif %}

    {% if prevgroup %} 
          <br />Go to <a href="/mainlog?place={{prevgroup}}"> {{prevgroup}}</a>, 
          previous group
    {% endif %}

          {% if nextgroup %} 
          <br />Go to <a href="/mainlog?place={{nextgroup}}"> {{nextgroup}}</a>, the
          next group
    {% endif %}

          {% if acrossgroup %} 
          <br />Go to <a href="/mainlog?place={{acrossgroup}}">
            {{acrossgroup}}</a>, the "across" group.
    {% endif %}

    <table border="1" cellpadding="5" cellspacing="0" class="sortable" id="unique-id" >
      <tr> 
        <td width="03%">ID</td>
        <td width="77%">
      <h4>{{moreinfoLog|escape|default:"Comment"}}</h4></td>
        <td width="10%">Name</td>
        <td width="06%">Date</td>
        <td width="02%">Cate gory</td>
        <td  width="02%">Pin label</td>
      </tr>
    {% for s in comments %}
    <tr>
      <td>{{ forloop.counter }}</td>
      <td>{{ s.comment|urlizetrunc:25 }}</td>
      <td> {{s.name|escape}}</td>
      <td> {{s.created}}</td>
      <td bgcolor="#{{s.scolor}}"> {{s.scategory}} </td>
      <td> {{s.pinlabel|escape}}</td>
    </tr> 
    {% endfor %}
    </table>

    {% if next %}
    <p><a href="/comment?bookmark={{ next }}&place={{place}}">View earlier comments</a></p>        
    {% endif %}
        

    <form action="/comment?place={{place}}"enctype="multipart/form-data"  method="Post">
      <label>Comment: </label><input type="text" name="comment" value="" />
      <label>Name: </label><input type="text" name="name" value="" />
      <label>Category:</label> 
          <select name="category" >
            {%for c in categories %}
            <option value={{forloop.counter0}}>{{c}}</option>
            {% endfor %}
          </select>
          <label>Pinlabel: </label><input type="text" name="pinlabel" value="" />
        <br />
        <label>Snapshot (max size 300K): </label><input type="file" name="img"/>
        <br />
        <label>Delete:</label> 
          <select name="deleteID" >
            <option value=""></option>
            {%for s in comments %}
            <option value={{s.key}}>{{forloop.counter}}</option>
            {% endfor %}
          </select>Be careful, this really deletes a comment and photo.
        <!--input type="hidden" name="ID" value="{{countLog}}" /-->
      <p>{{ captchahtml }}<input type="submit" value="Add" /></p>
      
    </form>
        <br />
            {%for s in comments %}
            {% ifnotequal s.imageindex 0 %}
            {{ forloop.counter }}
            <div><img src="img?img_id={{s.key}}"></img>
        <br />
        {% endifnotequal %}
            {% endfor %}
        <br />

  </body>
</html> 
